$(document).ready(function(){
	$("#searchChannelBtn_sp").click(function(){
		asyncbox.open({
			url : "../channel_readFindChannelPrice.action",
			width : 650,
			height : 450,
			top : 65,
			drag : false,
			modal : true,
			scrolling : "yes",
			title : "渠道信息",
			tipsbar : {
				title : '渠道信息查询',
				content : '渠道信息查询'
			},
			btnsbar : $.btn.OKCANCEL,
			callback : function(action,iframe,returnValue){
				if(action == 'ok'){
					var strs = returnValue.split("|:,:|");
					$("#channelName_sp").attr("value",strs[1]);
					$("#channelNum_sp").attr("value",strs[0]);
					var stp = document.getElementById("stPartition_sp");
					stp.options.length = 1;
					$.post("../partitionJson!findSPartitions.action",{"channelNumber":strs[0]},function(data){
						$(data.spartitions).each(function(){
							stp.options.add(new Option(this.partition_name,this.partition_number));
						});
					});
				}else{
					
				}
			}
		});
	});
	
	$("#searchClientBtn_sp").click(function(){
		asyncbox.open({
			url : "../specialPrice_readfindCustomers.action",
			width : 950,
			height : 450,
			top : 65,
			drag : false,
			modal : true,
			scrolling : "yes",
			title : "客户信息",
			tipsbar : {
				title : '客户信息查询',
				content : '客户信息查询'
			},
			btnsbar : $.btn.OKCANCEL,
			callback : function(action,iframe,returnValue){
				if(action == 'ok'){
					var strs = returnValue.split("|:,:|");
					$("#clientName").attr("value",strs[1]);
				}else{
					
				}
			}
		});
	});
});
